using System;
using System.Threading;
using seanfoy.oopsnet;

public class mtconsole {
    public static void run() {
	throw new Exception("crash");
    }

    /// <remarks>
    /// <c>void Main(String [] args)</c> would also work.
    /// </remarks>
    public static int Main(String [] args) {
	ConsoleErrorHandler.install();
	// maybe related: https://bugzilla.novell.com/show_bug.cgi?id=426289
	const int count = 8;
	if (args.Length > 0 && args[0] == "crash") {
	    Thread [] T = new Thread[count];
	    for (int i = 0; i < count; ++i) {
		T[i] = new Thread(new ThreadStart(run));
	    }
	    for (int i = 0; i < count; ++i) {
		T[i].Start();
	    }
	    for (int i = 0; i < count; ++i) {
		T[i].Join();
	    }
	}
	return 0;
    }
}
